//
//  WaitingTableViewCell.m
//  PeopleStreet
//
//  Created by 辰领科技 on 16/1/29.
//  Copyright © 2016年 yuf. All rights reserved.
//

#import "WaitingTableViewCell.h"

@implementation WaitingTableViewCell

- (void)awakeFromNib {
    // Initialization code
}

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        UIView * vLine = [[UIView alloc]initWithFrame:flexibleFrame(CGRectMake(0, 0, 320, 1), NO)];
        vLine.backgroundColor = [UIColor colorWithWhite:0.894 alpha:1.000];
//        [self.contentView addSubview:vLine];
        
        UIView * dLine = [[UIView alloc]initWithFrame:flexibleFrame(CGRectMake(0, 165, 320, 5), NO)];
        dLine.backgroundColor = [UIColor colorWithWhite:0.918 alpha:1.000];
//        [self.contentView addSubview:dLine];
        
        
        UIView * dline = [[UIView alloc]initWithFrame:flexibleFrame(CGRectMake(0, 127, 320, 1), NO)];
        dline.backgroundColor = [UIColor colorWithWhite:0.918 alpha:1.000];
//        [self.contentView addSubview:dline];
        
   
            

            
            _forSaleLabel =  [[UILabel alloc]initWithFrame:flexibleFrame(CGRectMake(13, 0, 292, 35), NO)];
            _forSaleLabel.textAlignment = NSTextAlignmentLeft;
            _forSaleLabel.textColor = [UIColor colorWithWhite:0.518 alpha:1.000];
            _forSaleLabel.font = [UIFont systemFontOfSize:14*VerticalTexeRatio()];
        [self.contentView addSubview:_forSaleLabel];
        

     
        
        //图片
        _goodsImage = [[UIImageView alloc]initWithFrame:flexibleFrame(CGRectMake(13 , 36, 79, 79), NO)];
        [self.contentView addSubview:_goodsImage];
        
        _infoLabel = [[UILabel alloc]initWithFrame:flexibleFrame(CGRectMake(103, 40, 190, 20), NO)];
        _infoLabel.numberOfLines = 0;
        _infoLabel.textAlignment = NSTextAlignmentLeft;
        _infoLabel.textColor = [UIColor colorWithWhite:0.196 alpha:1.000];
        _infoLabel.font = [UIFont systemFontOfSize:13*VerticalTexeRatio()];
        [self.contentView addSubview:_infoLabel];
        
        _propertyLabel = [[UILabel alloc]initWithFrame:flexibleFrame(CGRectMake(103, 75, 190, 20), NO)];
        _propertyLabel.numberOfLines = 0;
        _propertyLabel.textAlignment = NSTextAlignmentLeft;
        _propertyLabel.textColor = [UIColor colorWithWhite:0.631 alpha:1.000];
        _propertyLabel.font = [UIFont systemFontOfSize:12*VerticalTexeRatio()];
        [self.contentView addSubview:_propertyLabel];
        
        _priceLabel = [[UILabel alloc]initWithFrame:flexibleFrame(CGRectMake(102, 100, 80, 15), NO)];
        _priceLabel.textAlignment = NSTextAlignmentLeft;
        _priceLabel.textColor = [UIColor colorWithRed:0.859 green:0.161 blue:0.161 alpha:1.000];
        _priceLabel.font = [UIFont systemFontOfSize:16*VerticalTexeRatio()];
        [self.contentView addSubview:_priceLabel];
        
        
        _numberLabel = [[UILabel alloc]initWithFrame:flexibleFrame(CGRectMake(0, 102, 300, 15), NO)];
        _numberLabel.textAlignment = NSTextAlignmentRight;
        _numberLabel.textColor = [UIColor colorWithWhite:0.231 alpha:1.000];
        _numberLabel.font = [UIFont systemFontOfSize:13*VerticalTexeRatio()];
        
        [self.contentView addSubview:_numberLabel];
        
        
        _cancelButton = [UIButton buttonWithType:UIButtonTypeCustom];
        _cancelButton.frame = flexibleFrame(CGRectMake(188, 135, 55, 21), NO);
        _cancelButton.layer.borderWidth = 1;
        _cancelButton.layer.cornerRadius = 3*VerticalRatio();
        _cancelButton.layer.borderColor = [UIColor colorWithWhite:0.600 alpha:1.000].CGColor;
        _cancelButton.backgroundColor = [UIColor whiteColor];
        [_cancelButton setTitleColor:[UIColor colorWithWhite:0.600 alpha:1.000] forState:UIControlStateNormal];
        _cancelButton.titleLabel.font = [UIFont systemFontOfSize:12*VerticalTexeRatio()];
        [_cancelButton setTitle:@"取消订单" forState:UIControlStateNormal];
        [_cancelButton addTarget:self action:@selector(cancelHandel) forControlEvents:UIControlEventTouchUpInside];
//        [self.contentView addSubview:_cancelButton];
        
        
        _sureButton = [UIButton buttonWithType:UIButtonTypeCustom];
        _sureButton.frame = flexibleFrame(CGRectMake(254, 135, 55, 21), NO);
        _sureButton.layer.borderWidth = 1;
         _sureButton.layer.cornerRadius = 3*VerticalRatio();
        _sureButton.layer.borderColor = [UIColor colorWithRed:0.969 green:0.608 blue:0.090 alpha:1.000].CGColor;
        _sureButton.backgroundColor = [UIColor whiteColor];
        [_sureButton setTitleColor:[UIColor colorWithRed:0.969 green:0.608 blue:0.090 alpha:1.000] forState:UIControlStateNormal];
        _sureButton.titleLabel.font = [UIFont systemFontOfSize:12*VerticalTexeRatio()];
        [_sureButton setTitle:@"支付" forState:UIControlStateNormal];
        [_sureButton addTarget:self action:@selector(sureHandel) forControlEvents:UIControlEventTouchUpInside];
        
//        [self.contentView addSubview:_sureButton];
        
    }
    
    return self;
}

- (void)cancelHandel{
    _cancelBlock(@"1");
}

- (void)sureHandel{
    _sureBlock(@"1");
}
- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
